package com.crm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.crm.domain.entity.Clue;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.data.repository.query.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ClueMapper extends BaseMapper<Clue> {
    int getCluesNums(@Param("beginCreateTime") String beginCreateTime, @Param("endCreateTime") String endCreateTime);

    /**
     * 有效线索数
     * @return
     */
    int getEffectiveCluesNums(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);

    List<Map<String, Object>> cluesStatistics(String beginCreateTime, String endCreateTime);

    @Update("update clue set status = 4 where id = #{clueId}")
    void setFalseClueById(Long clueId);
}
